package com.ttdevs.util;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;

public class BaseClass extends BroadcastReceiver implements StaticConstants {

	private Context context;
	private Handler handler;
	private SharePreferenceUtil spUtil;

	public BaseClass(Context context, Handler handler) {
		this.context = context;
		this.handler = handler;
		this.spUtil = new SharePreferenceUtil(context);
	}

	public Context getContext() {
		return context;
	}

	public Handler getHandler() {
		return handler;
	}

	public SharePreferenceUtil getSPU() {
		return spUtil;
	}

	public void sendAlarmMessage(Object obj) {
		Message msg = new Message();
		msg.what = STATE_ALARM;
		msg.obj = obj;
		handler.sendMessage(msg);
	}
	public void sendMessage(int what) {
		Message msg = new Message();
		msg.what = what;
		handler.sendMessage(msg);
	}

	public void sendMessage(int what, Object obj) {
		Message msg = new Message();
		msg.what = what;
		msg.obj = obj;
		handler.sendMessage(msg);
	}

	@Override
	public void onReceive(Context context, Intent intent) {
		// TODO
	}
}
